#ifndef VNAV_MODEL3D_H
#define VNAV_MODEL3D_H

#include "implementations/model3d/Model3DDefs.h"
#include "implementations/geometry/Triangle.h"
#include <vector>
#include <map>

namespace vnav
{
	namespace model3d
	{
		class Model3D
		{
		public:
			struct FaceGroup
			{
				std::vector<vnav::geometry::Triangle<vnav::model3d::VertexData> > Polygons;
				VNString materialName;
			};
			void addVertex(const vnav::model3d::VERTEX3D& vertex);
			void addTexCoord(const vnav::model3d::TEXCOORD2D& texCoord);
			void addNormal(const vnav::model3d::NORMAL3D& normal);
			void addMaterial(const vnav::model3d::MATERIAL& material);
			void addFaceGroup(const vnav::model3d::Model3D::FaceGroup* faceGroup);
			vnav::model3d::MATERIAL getMaterialByName(VNString& name);
		protected:
		private:
			std::vector<vnav::model3d::VERTEX3D> m_vertices;
			std::vector<vnav::model3d::TEXCOORD2D> m_texcoords;
			std::vector<vnav::model3d::NORMAL3D> m_normals;
			std::map<VNString, vnav::model3d::MATERIAL> m_materials;
			std::vector<FaceGroup*> m_faceGroupList;
		};
	}
}

#endif